﻿@namespace MudBlazor
@inherits MudComponentBase

<MudDialog>
    <TitleContent>
        @if (TitleContent == null)
        {
            <MudText Typo="Typo.h6">@Title</MudText> }
        else
        {
            @TitleContent
        }
    </TitleContent>
    <DialogContent>
        @if(MessageContent!=null)
        {
            @MessageContent
        }
        else
        {
            @Message
        }
    </DialogContent>
    <DialogActions>
        @if (YesButton != null)
        {
            <CascadingValue Value="@_yesCallback">
                @YesButton
            </CascadingValue>
        }
        else if(!string.IsNullOrWhiteSpace(YesText))
        {
            <MudButton Color="Color.Primary" OnClick="OnYesClicked">@YesText</MudButton>
        }
        @if (NoButton != null)
        {
            <CascadingValue Value="@_noCallback">
                @NoButton
            </CascadingValue>
        }
        else if(!string.IsNullOrWhiteSpace(NoText))
        {
            <MudButton OnClick="OnNoClicked">@NoText</MudButton>
        }
        @if (CancelButton != null)
        {
            <CascadingValue Value="@_cancelCallback">
                @CancelButton
            </CascadingValue>
        }
        else if(!string.IsNullOrWhiteSpace(CancelText))
        {
            <MudButton OnClick="OnCancelClicked">@CancelText</MudButton>
        }
    </DialogActions>
</MudDialog>